<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTPrint3D.h</h1><a href="PVRTPrint3D_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTPrint3D.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        PVRTPrint3D</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Code to print text through the 3D interface.</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 <span class="preprocessor">#ifndef _PVRTPRINT3D_H_</span>
00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTPRINT3D_H_</span>
00018 <span class="preprocessor"></span>
00019 <span class="preprocessor">#include "<a class="code" href="PVRTGlobal_8h.html">PVRTGlobal.h</a>"</span>
00020 <span class="preprocessor">#include "<a class="code" href="PVRTContext_8h.html">PVRTContext.h</a>"</span>
00021 <span class="preprocessor">#include "<a class="code" href="PVRTError_8h.html">PVRTError.h</a>"</span>
00022 
00023 <span class="comment">/****************************************************************************</span>
00024 <span class="comment">** Defines</span>
00025 <span class="comment">****************************************************************************/</span>
<a name="l00026"></a><a class="code" href="PVRTPrint3D_8h.html#a0">00026</a> <span class="preprocessor">#define PVRTPRINT3D_MAX_WINDOWS             (512)</span>
<a name="l00027"></a><a class="code" href="PVRTPrint3D_8h.html#a1">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define PVRTPRINT3D_MAX_RENDERABLE_LETTERS  (0xFFFF &gt;&gt; 2)</span>
00028 <span class="preprocessor"></span>
00029 <span class="comment">/****************************************************************************</span>
00030 <span class="comment">** Enums</span>
00031 <span class="comment">****************************************************************************/</span>
00032 
00033 <span class="comment">/*!***************************************************************************</span>
00034 <span class="comment"> dwFlags for PVRTPrint3DSetWindowFlags</span>
00035 <span class="comment">*****************************************************************************/</span>
<a name="l00036"></a><a class="code" href="PVRTPrint3D_8h.html#a14">00036</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
00037     <a class="code" href="PVRTPrint3D_8h.html#a14a2">ePVRTPrint3D_ACTIVATE_WIN</a>       =   0x01,
00038     <a class="code" href="PVRTPrint3D_8h.html#a14a3">ePVRTPrint3D_DEACTIVATE_WIN</a>     =   0x02,
00039     <a class="code" href="PVRTPrint3D_8h.html#a14a4">ePVRTPrint3D_ACTIVATE_TITLE</a>     =   0x04,
00040     <a class="code" href="PVRTPrint3D_8h.html#a14a5">ePVRTPrint3D_DEACTIVATE_TITLE</a>   =   0x08,
00041     <a class="code" href="PVRTPrint3D_8h.html#a14a6">ePVRTPrint3D_FULL_OPAQUE</a>        =   0x10,
00042     <a class="code" href="PVRTPrint3D_8h.html#a14a7">ePVRTPrint3D_FULL_TRANS</a>         =   0x20,
00043     <a class="code" href="PVRTPrint3D_8h.html#a14a8">ePVRTPrint3D_ADJUST_SIZE_ALWAYS</a> =   0x40,
00044     <a class="code" href="PVRTPrint3D_8h.html#a14a9">ePVRTPrint3D_NO_BORDER</a>          =   0x80
00045 } <a class="code" href="PVRTPrint3D_8h.html#a14">EPVRTPrint3DFlags</a>;
00046 
00047 <span class="comment">/*!***************************************************************************</span>
00048 <span class="comment"> Logo flags for DisplayDefaultTitle</span>
00049 <span class="comment">*****************************************************************************/</span>
<a name="l00050"></a><a class="code" href="PVRTPrint3D_8h.html#a15">00050</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
00051     <a class="code" href="PVRTPrint3D_8h.html#a15a10">ePVRTPrint3DLogoNone</a>  = 0x00,
00052     <a class="code" href="PVRTPrint3D_8h.html#a15a11">ePVRTPrint3DLogoPVR</a> = 0x02,
00053     <a class="code" href="PVRTPrint3D_8h.html#a15a12">ePVRTPrint3DLogoIMG</a> = 0x04,
00054     <a class="code" href="PVRTPrint3D_8h.html#a15a13">ePVRTPrint3DSDKLogo</a> = <a class="code" href="PVRTPrint3D_8h.html#a15a12">ePVRTPrint3DLogoIMG</a>
00055 } <a class="code" href="PVRTPrint3D_8h.html#a15">EPVRTPrint3DLogo</a>;
00056 
00057 <span class="comment">/****************************************************************************</span>
00058 <span class="comment">** Structures</span>
00059 <span class="comment">****************************************************************************/</span>
00060 <span class="comment">/*!**************************************************************************</span>
00061 <span class="comment">@Struct SPVRTPrint3DAPIVertex</span>
00062 <span class="comment">@Brief A structure for Print3Ds vertex type</span>
00063 <span class="comment">****************************************************************************/</span>
<a name="l00064"></a><a class="code" href="structSPVRTPrint3DAPIVertex.html">00064</a> <span class="keyword">struct </span><a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>
00065 {
<a name="l00066"></a><a class="code" href="structSPVRTPrint3DAPIVertex.html#o2">00066</a>     <a class="code" href="PVRTFixedPoint_8h.html#a0">VERTTYPE</a>        <a class="code" href="structSPVRTPrint3DAPIVertex.html#o0">sx</a>, <a class="code" href="structSPVRTPrint3DAPIVertex.html#o1">sy</a>, <a class="code" href="structSPVRTPrint3DAPIVertex.html#o2">sz</a>, <a class="code" href="structSPVRTPrint3DAPIVertex.html#o3">rhw</a>;
<a name="l00067"></a><a class="code" href="structSPVRTPrint3DAPIVertex.html#o4">00067</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    <a class="code" href="structSPVRTPrint3DAPIVertex.html#o4">color</a>;
<a name="l00068"></a><a class="code" href="structSPVRTPrint3DAPIVertex.html#o6">00068</a>     <a class="code" href="PVRTFixedPoint_8h.html#a0">VERTTYPE</a>        <a class="code" href="structSPVRTPrint3DAPIVertex.html#o5">tu</a>, <a class="code" href="structSPVRTPrint3DAPIVertex.html#o6">tv</a>;
00069 };
00070 
00071 <span class="comment">/*!**************************************************************************</span>
00072 <span class="comment">@Struct SPVRTPrint3DWIN</span>
00073 <span class="comment">@Brief A structure for Print3Ds data</span>
00074 <span class="comment">****************************************************************************/</span>
<a name="l00075"></a><a class="code" href="structSPVRTPrint3DWIN.html">00075</a> <span class="keyword">struct </span><a class="code" href="structSPVRTPrint3DWIN.html">SPVRTPrint3DWIN</a>
00076 {
<a name="l00077"></a><a class="code" href="structSPVRTPrint3DWIN.html#o0">00077</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o0">dwFlags</a>;
00078 
<a name="l00079"></a><a class="code" href="structSPVRTPrint3DWIN.html#o1">00079</a>     <span class="keywordtype">bool</span>                    <a class="code" href="structSPVRTPrint3DWIN.html#o1">bNeedUpdated</a>;
00080 
00081     <span class="comment">// Text Buffer</span>
<a name="l00082"></a><a class="code" href="structSPVRTPrint3DWIN.html#o2">00082</a>     <span class="keywordtype">char</span>                    *<a class="code" href="structSPVRTPrint3DWIN.html#o2">pTextBuffer</a>;
<a name="l00083"></a><a class="code" href="structSPVRTPrint3DWIN.html#o3">00083</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o3">dwBufferSizeX</a>;
<a name="l00084"></a><a class="code" href="structSPVRTPrint3DWIN.html#o4">00084</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o4">dwBufferSizeY</a>;
00085 
00086     <span class="comment">// Title</span>
<a name="l00087"></a><a class="code" href="structSPVRTPrint3DWIN.html#o5">00087</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o5">fTitleFontSize</a>;
<a name="l00088"></a><a class="code" href="structSPVRTPrint3DWIN.html#o6">00088</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o6">fTextRMinPos</a>;
<a name="l00089"></a><a class="code" href="structSPVRTPrint3DWIN.html#o7">00089</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o7">dwTitleFontColorL</a>;
<a name="l00090"></a><a class="code" href="structSPVRTPrint3DWIN.html#o8">00090</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o8">dwTitleFontColorR</a>;
<a name="l00091"></a><a class="code" href="structSPVRTPrint3DWIN.html#o9">00091</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o9">dwTitleBaseColor</a>;
<a name="l00092"></a><a class="code" href="structSPVRTPrint3DWIN.html#o10">00092</a>     <span class="keywordtype">char</span>                    *<a class="code" href="structSPVRTPrint3DWIN.html#o10">bTitleTextL</a>;
<a name="l00093"></a><a class="code" href="structSPVRTPrint3DWIN.html#o11">00093</a>     <span class="keywordtype">char</span>                    *<a class="code" href="structSPVRTPrint3DWIN.html#o11">bTitleTextR</a>;
<a name="l00094"></a><a class="code" href="structSPVRTPrint3DWIN.html#o12">00094</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o12">nTitleVerticesL</a>;
<a name="l00095"></a><a class="code" href="structSPVRTPrint3DWIN.html#o13">00095</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o13">nTitleVerticesR</a>;
<a name="l00096"></a><a class="code" href="structSPVRTPrint3DWIN.html#o14">00096</a>     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *<a class="code" href="structSPVRTPrint3DWIN.html#o14">pTitleVtxL</a>;
<a name="l00097"></a><a class="code" href="structSPVRTPrint3DWIN.html#o15">00097</a>     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *<a class="code" href="structSPVRTPrint3DWIN.html#o15">pTitleVtxR</a>;
00098 
00099     <span class="comment">// Window</span>
<a name="l00100"></a><a class="code" href="structSPVRTPrint3DWIN.html#o16">00100</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o16">fWinFontSize</a>;
<a name="l00101"></a><a class="code" href="structSPVRTPrint3DWIN.html#o17">00101</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o17">dwWinFontColor</a>;
<a name="l00102"></a><a class="code" href="structSPVRTPrint3DWIN.html#o18">00102</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o18">dwWinBaseColor</a>;
<a name="l00103"></a><a class="code" href="structSPVRTPrint3DWIN.html#o19">00103</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o19">fWinPos</a>[2];
<a name="l00104"></a><a class="code" href="structSPVRTPrint3DWIN.html#o20">00104</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o20">fWinSize</a>[2];
<a name="l00105"></a><a class="code" href="structSPVRTPrint3DWIN.html#o21">00105</a>     <span class="keywordtype">float</span>                   <a class="code" href="structSPVRTPrint3DWIN.html#o21">fZPos</a>;
<a name="l00106"></a><a class="code" href="structSPVRTPrint3DWIN.html#o22">00106</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o22">dwSort</a>;
<a name="l00107"></a><a class="code" href="structSPVRTPrint3DWIN.html#o23">00107</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            <a class="code" href="structSPVRTPrint3DWIN.html#o23">nLineVertices</a>[255]; <span class="comment">// every line of text is allocated and drawn apart.</span>
<a name="l00108"></a><a class="code" href="structSPVRTPrint3DWIN.html#o24">00108</a>     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *<a class="code" href="structSPVRTPrint3DWIN.html#o24">pLineVtx</a>[256];
<a name="l00109"></a><a class="code" href="structSPVRTPrint3DWIN.html#o25">00109</a>     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *<a class="code" href="structSPVRTPrint3DWIN.html#o25">pWindowVtxTitle</a>;
<a name="l00110"></a><a class="code" href="structSPVRTPrint3DWIN.html#o26">00110</a>     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *<a class="code" href="structSPVRTPrint3DWIN.html#o26">pWindowVtxText</a>;
00111 };
00112 
00113 <span class="keyword">struct </span>SPVRTPrint3DAPI;
00114 
00115 <span class="comment">/*!***************************************************************************</span>
00116 <span class="comment"> @Class CPVRTPrint3D</span>
00117 <span class="comment"> @Brief Display text/logos on the screen</span>
00118 <span class="comment">*****************************************************************************/</span>
<a name="l00119"></a><a class="code" href="classCPVRTPrint3D.html">00119</a> <span class="keyword">class </span><a class="code" href="classCPVRTPrint3D.html">CPVRTPrint3D</a>
00120 {
00121 <span class="keyword">public</span>:
00122     <span class="comment">/*!***************************************************************************</span>
00123 <span class="comment">     @Function          CPVRTPrint3D</span>
00124 <span class="comment">     @Description       Init some values.</span>
00125 <span class="comment">    *****************************************************************************/</span>
00126     <a class="code" href="classCPVRTPrint3D.html#a0">CPVRTPrint3D</a>();
00127     <span class="comment">/*!***************************************************************************</span>
00128 <span class="comment">     @Function          ~CPVRTPrint3D</span>
00129 <span class="comment">     @Description       De-allocate the working memory</span>
00130 <span class="comment">    *****************************************************************************/</span>
00131     <a class="code" href="classCPVRTPrint3D.html#a1">~CPVRTPrint3D</a>();
00132 
00133     <span class="comment">/*!***************************************************************************</span>
00134 <span class="comment">     @Function          PVRTPrint3DSetTextures</span>
00135 <span class="comment">     @Input             pContext        Context</span>
00136 <span class="comment">     @Input             dwScreenX       Screen resolution along X</span>
00137 <span class="comment">     @Input             dwScreenY       Screen resolution along Y</span>
00138 <span class="comment">     @Input             bRotate         Rotate print3D by 90 degrees</span>
00139 <span class="comment">     @Return            PVR_SUCCESS or PVR_FAIL</span>
00140 <span class="comment">     @Description       Initialization and texture upload. Should be called only once</span>
00141 <span class="comment">                        for a given context.</span>
00142 <span class="comment">    *****************************************************************************/</span>
00143     <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPrint3D.html#a2">SetTextures</a>(
00144         <span class="keyword">const</span> <a class="code" href="structSPVRTContext.html">SPVRTContext</a>  * <span class="keyword">const</span> pContext,
00145         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  dwScreenX,
00146         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>  dwScreenY,
00147         <span class="keyword">const</span> <span class="keywordtype">bool</span> bRotate = <span class="keyword">false</span>);
00148 
00149     <span class="comment">/*!***************************************************************************</span>
00150 <span class="comment">     @Function          PVRTPrint3D</span>
00151 <span class="comment">     @Input             fPosX       Position of the text along X</span>
00152 <span class="comment">     @Input             fPosY       Position of the text along Y</span>
00153 <span class="comment">     @Input             fScale      Scale of the text</span>
00154 <span class="comment">     @Input             Colour      Colour of the text</span>
00155 <span class="comment">     @Input             pszFormat   Format string for the text</span>
00156 <span class="comment">     @Return            PVR_SUCCESS or PVR_FAIL</span>
00157 <span class="comment">     @Description       Display 3D text on screen.</span>
00158 <span class="comment">                        No window needs to be allocated to use this function.</span>
00159 <span class="comment">                        However, PVRTPrint3DSetTextures(...) must have been called</span>
00160 <span class="comment">                        beforehand.</span>
00161 <span class="comment">                        This function accepts formatting in the printf way.</span>
00162 <span class="comment">    *****************************************************************************/</span>
00163     <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPrint3D.html#a3">Print3D</a>(<span class="keywordtype">float</span> fPosX, <span class="keywordtype">float</span> fPosY, <span class="keyword">const</span> <span class="keywordtype">float</span> fScale, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Colour, <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszFormat, ...);
00164 
00165     <span class="comment">/*!***************************************************************************</span>
00166 <span class="comment">     @Function          DisplayDefaultTitle</span>
00167 <span class="comment">     @Input             pszTitle            Title to display</span>
00168 <span class="comment">     @Input             pszDescription      Description to display</span>
00169 <span class="comment">     @Input             uDisplayLogo        1 = Display the logo</span>
00170 <span class="comment">     @Return            PVR_SUCCESS or PVR_FAIL</span>
00171 <span class="comment">     @Description       Creates a default title with predefined position and colours.</span>
00172 <span class="comment">                        It displays as well company logos when requested:</span>
00173 <span class="comment">                        0 = No logo</span>
00174 <span class="comment">                        1 = PowerVR logo</span>
00175 <span class="comment">                        2 = Img Tech logo</span>
00176 <span class="comment">    *****************************************************************************/</span>
00177      <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPrint3D.html#a4">DisplayDefaultTitle</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszTitle, <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszDescription, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> uDisplayLogo);
00178 
00179     <span class="comment">/*!***************************************************************************</span>
00180 <span class="comment">     @Function          CreateDefaultWindow</span>
00181 <span class="comment">     @Input             fPosX                   Position X for the new window</span>
00182 <span class="comment">     @Input             fPosY                   Position Y for the new window</span>
00183 <span class="comment">     @Input             nXSize_LettersPerLine</span>
00184 <span class="comment">     @Input             sTitle                  Title of the window</span>
00185 <span class="comment">     @Input             sBody                   Body text of the window</span>
00186 <span class="comment">     @Return            Window handle</span>
00187 <span class="comment">     @Description       Creates a default window.</span>
00188 <span class="comment">                        If Title is NULL the main body will have just one line</span>
00189 <span class="comment">                        (for InfoWin).</span>
00190 <span class="comment">    *****************************************************************************/</span>
00191     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTPrint3D.html#a5">CreateDefaultWindow</a>(<span class="keywordtype">float</span> fPosX, <span class="keywordtype">float</span> fPosY, <span class="keywordtype">int</span> nXSize_LettersPerLine, <span class="keywordtype">char</span> *sTitle, <span class="keywordtype">char</span> *sBody);
00192 
00193     <span class="comment">/*!***************************************************************************</span>
00194 <span class="comment">     @Function          InitWindow</span>
00195 <span class="comment">     @Input             dwBufferSizeX       Buffer width</span>
00196 <span class="comment">     @Input             dwBufferSizeY       Buffer height</span>
00197 <span class="comment">     @Return            Window handle</span>
00198 <span class="comment">     @Description       Allocate a buffer for a newly-created window and return its</span>
00199 <span class="comment">                        handle.</span>
00200 <span class="comment">    *****************************************************************************/</span>
00201     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTPrint3D.html#a6">InitWindow</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwBufferSizeX, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwBufferSizeY);
00202 
00203     <span class="comment">/*!***************************************************************************</span>
00204 <span class="comment">     @Function          DeleteWindow</span>
00205 <span class="comment">     @Input             dwWin       Window handle</span>
00206 <span class="comment">     @Description       Delete the window referenced by dwWin.</span>
00207 <span class="comment">    *****************************************************************************/</span>
00208     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a7">DeleteWindow</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin);
00209 
00210     <span class="comment">/*!***************************************************************************</span>
00211 <span class="comment">     @Function          DeleteAllWindows</span>
00212 <span class="comment">     @Description       Delete all windows.</span>
00213 <span class="comment">    *****************************************************************************/</span>
00214     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a8">DeleteAllWindows</a>();
00215 
00216     <span class="comment">/*!***************************************************************************</span>
00217 <span class="comment">     @Function          DisplayWindow</span>
00218 <span class="comment">     @Input             dwWin</span>
00219 <span class="comment">     @Return            PVR_SUCCESS or PVR_FAIL</span>
00220 <span class="comment">     @Description       Display window.</span>
00221 <span class="comment">                        This function MUST be called between a BeginScene/EndScene</span>
00222 <span class="comment">                        pair as it uses D3D render primitive calls.</span>
00223 <span class="comment">                        PVRTPrint3DSetTextures(...) must have been called beforehand.</span>
00224 <span class="comment">    *****************************************************************************/</span>
00225     <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPrint3D.html#a9">DisplayWindow</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin);
00226 
00227     <span class="comment">/*!***************************************************************************</span>
00228 <span class="comment">     @Function          SetText</span>
00229 <span class="comment">     @Input             dwWin       Window handle</span>
00230 <span class="comment">     @Input             Format      Format string</span>
00231 <span class="comment">     @Return            PVR_SUCCESS or PVR_FAIL</span>
00232 <span class="comment">     @Description       Feed the text buffer of window referenced by dwWin.</span>
00233 <span class="comment">                        This function accepts formatting in the printf way.</span>
00234 <span class="comment">    *****************************************************************************/</span>
00235     <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPrint3D.html#a10">SetText</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keyword">const</span> <span class="keywordtype">char</span> *Format, ...);
00236 
00237     <span class="comment">/*!***************************************************************************</span>
00238 <span class="comment">     @Function          SetWindow</span>
00239 <span class="comment">     @Input             dwWin           Window handle</span>
00240 <span class="comment">     @Input             dwWinColor      Window colour</span>
00241 <span class="comment">     @Input             dwFontColor     Font colour</span>
00242 <span class="comment">     @Input             fFontSize       Font size</span>
00243 <span class="comment">     @Input             fPosX           Window position X</span>
00244 <span class="comment">     @Input             fPosY           Window position Y</span>
00245 <span class="comment">     @Input             fSizeX          Window size X</span>
00246 <span class="comment">     @Input             fSizeY          Window size Y</span>
00247 <span class="comment">     @Description       Set attributes of window.</span>
00248 <span class="comment">                        Windows position and size are referred to a virtual screen</span>
00249 <span class="comment">                        of 100x100. (0,0) is the top-left corner and (100,100) the</span>
00250 <span class="comment">                        bottom-right corner.</span>
00251 <span class="comment">                        These values are the same for all resolutions.</span>
00252 <span class="comment">    *****************************************************************************/</span>
00253     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a11">SetWindow</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWinColor, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwFontColor, <span class="keywordtype">float</span> fFontSize,
00254                               <span class="keywordtype">float</span> fPosX, <span class="keywordtype">float</span> fPosY, <span class="keywordtype">float</span> fSizeX, <span class="keywordtype">float</span> fSizeY);
00255 
00256     <span class="comment">/*!***************************************************************************</span>
00257 <span class="comment">     @Function          SetTitle</span>
00258 <span class="comment">     @Input             dwWin               Window handle</span>
00259 <span class="comment">     @Input             dwBackgroundColor   Background color</span>
00260 <span class="comment">     @Input             fFontSize           Font size</span>
00261 <span class="comment">     @Input             dwFontColorLeft</span>
00262 <span class="comment">     @Input             sTitleLeft</span>
00263 <span class="comment">     @Input             dwFontColorRight</span>
00264 <span class="comment">     @Input             sTitleRight</span>
00265 <span class="comment">     @Description       Set window title.</span>
00266 <span class="comment">    *****************************************************************************/</span>
00267     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a12">SetTitle</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwBackgroundColor, <span class="keywordtype">float</span> fFontSize,
00268                              <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwFontColorLeft, <span class="keywordtype">char</span> *sTitleLeft,
00269                              <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwFontColorRight, <span class="keywordtype">char</span> *sTitleRight);
00270 
00271     <span class="comment">/*!***************************************************************************</span>
00272 <span class="comment">     @Function          SetWindowFlags</span>
00273 <span class="comment">     @Input             dwWin               Window handle</span>
00274 <span class="comment">     @Input             dwFlags             Flags</span>
00275 <span class="comment">     @Description       Set flags for window referenced by dwWin.</span>
00276 <span class="comment">                        A list of flag can be found at the top of this header.</span>
00277 <span class="comment">    *****************************************************************************/</span>
00278     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a13">SetWindowFlags</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwFlags);
00279 
00280     <span class="comment">/*!***************************************************************************</span>
00281 <span class="comment">     @Function          AdjustWindowSize</span>
00282 <span class="comment">     @Input             dwWin               Window handle</span>
00283 <span class="comment">     @Input             dwMode              dwMode 0 = Both, dwMode 1 = X only,  dwMode 2 = Y only</span>
00284 <span class="comment">     @Description       Calculates window size so that all text fits in the window.</span>
00285 <span class="comment">    *****************************************************************************/</span>
00286     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a14">AdjustWindowSize</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwMode);
00287 
00288     <span class="comment">/*!***************************************************************************</span>
00289 <span class="comment">     @Function          GetSize</span>
00290 <span class="comment">     @Output            pfWidth             Width of the string in pixels</span>
00291 <span class="comment">     @Output            pfHeight            Height of the string in pixels</span>
00292 <span class="comment">     @Input             fFontSize           Font size</span>
00293 <span class="comment">     @Input             sString             String to take the size of</span>
00294 <span class="comment">     @Description       Returns the size of a string in pixels.</span>
00295 <span class="comment">    *****************************************************************************/</span>
00296     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a15">GetSize</a>(
00297         <span class="keywordtype">float</span>       * <span class="keyword">const</span> pfWidth,
00298         <span class="keywordtype">float</span>       * <span class="keyword">const</span> pfHeight,
00299         <span class="keyword">const</span> <span class="keywordtype">float</span> fFontSize,
00300         <span class="keyword">const</span> <span class="keywordtype">char</span>  * sString);
00301 
00302     <span class="comment">/*!***************************************************************************</span>
00303 <span class="comment">     @Function          GetAspectRatio</span>
00304 <span class="comment">     @Output            dwScreenX       Screen resolution X</span>
00305 <span class="comment">     @Output            dwScreenY       Screen resolution Y</span>
00306 <span class="comment">     @Description       Returns the current resolution used by Print3D</span>
00307 <span class="comment">    *****************************************************************************/</span>
00308     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a16">GetAspectRatio</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *dwScreenX, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *dwScreenY);
00309 
00310 <span class="keyword">private</span>:
00311     <span class="comment">/*!***************************************************************************</span>
00312 <span class="comment">     @Function          UpdateBackgroundWindow</span>
00313 <span class="comment">     @Return            true if succesful, false otherwise.</span>
00314 <span class="comment">     @Description       Draw a generic rectangle (with or without border).</span>
00315 <span class="comment">    *****************************************************************************/</span>
00316     <span class="keywordtype">bool</span> UpdateBackgroundWindow(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Color, <span class="keywordtype">float</span> fZPos, <span class="keywordtype">float</span> fPosX, <span class="keywordtype">float</span> fPosY, <span class="keywordtype">float</span> fSizeX, <span class="keywordtype">float</span> fSizeY, <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a> **ppVtx);
00317 
00318     <span class="comment">/*!***************************************************************************</span>
00319 <span class="comment">     @Function          UpdateLine</span>
00320 <span class="comment">     @Description</span>
00321 <span class="comment">    *****************************************************************************/</span>
00322     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> UpdateLine(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin, <span class="keyword">const</span> <span class="keywordtype">float</span> fZPos, <span class="keywordtype">float</span> XPos, <span class="keywordtype">float</span> YPos, <span class="keyword">const</span> <span class="keywordtype">float</span> fScale, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Colour, <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> Text, <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a> * <span class="keyword">const</span> pVertices);
00323 
00324     <span class="comment">/*!***************************************************************************</span>
00325 <span class="comment">     @Function          DrawLineUP</span>
00326 <span class="comment">     @Return            true or false</span>
00327 <span class="comment">     @Description       Draw a single line of text.</span>
00328 <span class="comment">    *****************************************************************************/</span>
00329     <span class="keywordtype">bool</span> DrawLineUP(<a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a> *pVtx, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nVertices);
00330 
00331     <span class="comment">/*!***************************************************************************</span>
00332 <span class="comment">     @Function          UpdateTitleVertexBuffer</span>
00333 <span class="comment">     @Return            true or false</span>
00334 <span class="comment">     @Description       Updates the vertex buffer used for the title</span>
00335 <span class="comment">    *****************************************************************************/</span>
00336     <span class="keywordtype">bool</span> UpdateTitleVertexBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin);
00337 
00338     <span class="comment">/*!***************************************************************************</span>
00339 <span class="comment">     @Function          UpdateMainTextVertexBuffer</span>
00340 <span class="comment">     @Return            true or false</span>
00341 <span class="comment">     @Description       Updates the vertex buffer used for the main text</span>
00342 <span class="comment">    *****************************************************************************/</span>
00343     <span class="keywordtype">bool</span> UpdateMainTextVertexBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dwWin);
00344 
00345     <span class="comment">/*!***************************************************************************</span>
00346 <span class="comment">     @Function          GetLength</span>
00347 <span class="comment">     @Description       calculates the size in pixels.</span>
00348 <span class="comment">    *****************************************************************************/</span>
00349     <span class="keywordtype">float</span> GetLength(<span class="keywordtype">float</span> fFontSize, <span class="keywordtype">char</span> *sString);
00350 
00351     <span class="comment">/*!***************************************************************************</span>
00352 <span class="comment">     @Function          Rotate</span>
00353 <span class="comment">     @Description       Rotates the vertices to fit on screen.</span>
00354 <span class="comment">    *****************************************************************************/</span>
00355     <span class="keywordtype">void</span> Rotate(<a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a> * <span class="keyword">const</span> pv, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nCnt);
00356 
00357 <span class="keyword">private</span>:
00358     SPVRTPrint3DAPI         *m_pAPI;
00359     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            m_uLogoToDisplay;
00360     <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>          *m_pwFacesFont;
00361     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *m_pPrint3dVtx;
00362     <span class="keywordtype">float</span>                   m_fScreenScale[2];
00363     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>            m_ui32ScreenDim[2];
00364     <span class="keywordtype">bool</span>                    m_bTexturesSet;
00365     <a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a>   *m_pVtxCache;
00366     <span class="keywordtype">int</span>                     m_nVtxCache;
00367     <span class="keywordtype">int</span>                     m_nVtxCacheMax;
00368     <a class="code" href="structSPVRTPrint3DWIN.html">SPVRTPrint3DWIN</a>         m_pWin[<a class="code" href="PVRTPrint3D_8h.html#a0">PVRTPRINT3D_MAX_WINDOWS</a>];
00369     <span class="keywordtype">bool</span>                    m_bRotate;
00370 
00371 <span class="keyword">public</span>:
00372     <span class="comment">/*!***************************************************************************</span>
00373 <span class="comment">     @Function          PVRTPrint3DReleaseTextures</span>
00374 <span class="comment">     @Description       Deallocate the memory allocated in PVRTPrint3DSetTextures(...)</span>
00375 <span class="comment">    *****************************************************************************/</span>
00376     <span class="keywordtype">void</span> <a class="code" href="classCPVRTPrint3D.html#a17">ReleaseTextures</a>();
00377 
00378     <span class="comment">/*!***************************************************************************</span>
00379 <span class="comment">     @Function          Flush</span>
00380 <span class="comment">     @Description       Flushes all the print text commands</span>
00381 <span class="comment">    *****************************************************************************/</span>
00382     <span class="keywordtype">int</span> <a class="code" href="classCPVRTPrint3D.html#a18">Flush</a>();
00383 
00384 <span class="comment">/*!***************************************************************************</span>
00385 <span class="comment">@Brief          API specific code</span>
00386 <span class="comment">@Description    The following functions are API specific. Their implementation</span>
00387 <span class="comment">                can be found in the directory *CurrentAPI*\PVRTPrint3DAPI</span>
00388 <span class="comment">*****************************************************************************/</span>
00389 <span class="keyword">private</span>:
00390     <span class="comment">/*!***************************************************************************</span>
00391 <span class="comment">     @Function          APIInit</span>
00392 <span class="comment">     @Return            true or false</span>
00393 <span class="comment">     @Description       Initialization and texture upload. Should be called only once</span>
00394 <span class="comment">                        for a given context.</span>
00395 <span class="comment">    *****************************************************************************/</span>
00396     <span class="keywordtype">bool</span> APIInit(<span class="keyword">const</span> <a class="code" href="structSPVRTContext.html">SPVRTContext</a> * <span class="keyword">const</span> pContext);
00397 
00398     <span class="comment">/*!***************************************************************************</span>
00399 <span class="comment">     @Function          APIRelease</span>
00400 <span class="comment">     @Description       Deinitialization.</span>
00401 <span class="comment">    *****************************************************************************/</span>
00402     <span class="keywordtype">void</span> APIRelease();
00403 
00404     <span class="comment">/*!***************************************************************************</span>
00405 <span class="comment">     @Function          APIUpLoadIcons</span>
00406 <span class="comment">     @Return            true or false</span>
00407 <span class="comment">     @Description       Initialization and texture upload. Should be called only once</span>
00408 <span class="comment">                        for a given context.</span>
00409 <span class="comment">    *****************************************************************************/</span>
00410     <span class="keywordtype">bool</span> APIUpLoadIcons(
00411         <span class="keyword">const</span> <a class="code" href="PVRTGlobal_8h.html#a19">PVRTuint32</a> * <span class="keyword">const</span> pPVR,
00412         <span class="keyword">const</span> <a class="code" href="PVRTGlobal_8h.html#a19">PVRTuint32</a> * <span class="keyword">const</span> pIMG);
00413 
00414     <span class="comment">/*!***************************************************************************</span>
00415 <span class="comment">     @Function          APIUpLoad4444</span>
00416 <span class="comment">     @Return            true if succesful, false otherwise.</span>
00417 <span class="comment">     @Description       Reads texture data from *.dat and loads it in</span>
00418 <span class="comment">                        video memory.</span>
00419 <span class="comment">    *****************************************************************************/</span>
00420     <span class="keywordtype">bool</span> APIUpLoad4444(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> TexID, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pSource, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nSize, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nMode);
00421 
00422     <span class="comment">/*!***************************************************************************</span>
00423 <span class="comment">     @Function          DrawBackgroundWindowUP</span>
00424 <span class="comment">     @Description</span>
00425 <span class="comment">    *****************************************************************************/</span>
00426     <span class="keywordtype">void</span> DrawBackgroundWindowUP(<a class="code" href="structSPVRTPrint3DAPIVertex.html">SPVRTPrint3DAPIVertex</a> *pVtx, <span class="keyword">const</span> <span class="keywordtype">bool</span> bIsOp, <span class="keyword">const</span> <span class="keywordtype">bool</span> bBorder);
00427 
00428     <span class="comment">/*!***************************************************************************</span>
00429 <span class="comment">     @Function          APIRenderStates</span>
00430 <span class="comment">     @Description       Stores, writes and restores Render States</span>
00431 <span class="comment">    *****************************************************************************/</span>
00432     <span class="keywordtype">void</span> APIRenderStates(<span class="keywordtype">int</span> nAction);
00433 
00434     <span class="comment">/*!***************************************************************************</span>
00435 <span class="comment">     @Function          APIDrawLogo</span>
00436 <span class="comment">     @Description       nPos = -1 to the left</span>
00437 <span class="comment">                        nPos = +1 to the right</span>
00438 <span class="comment">    *****************************************************************************/</span>
00439     <span class="keywordtype">void</span> APIDrawLogo(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> uLogoToDisplay, <span class="keywordtype">int</span> nPos);
00440 };
00441 
00442 
00443 <span class="preprocessor">#endif </span><span class="comment">/* _PVRTPRINT3D_H_ */</span>
00444 
00445 <span class="comment">/*****************************************************************************</span>
00446 <span class="comment"> End of file (PVRTPrint3D.h)</span>
00447 <span class="comment">*****************************************************************************/</span>
00448 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
